<link rel="stylesheet" type="text/css" href="<?php echo url::base(FALSE) ?>css/content.css">
<table>
    <tr><td id="dbuser">Database User</td><td></td></tr>
    <tr>
        <td width="70%" class="content">
            <table border="1" align="center" width="100%" class="tabcontent">
                <tr>
                    <td width="50">ID</td>
                    <td>Username</td>
                    <td>Peran</td>
                </tr>
                <?php if(isset($user)):?>
                <?php foreach($user->get_all_user() as $user) : ?>
                <tr>
                    <td><?php echo $user->user_ID_user ?></td>
                    <td><?php echo $user->user_username ?></td>
                    <td><?php echo $user->role_nama ?></td>
                </tr>
                <?php endforeach ?>
                <?php endif; ?>
            </table>
        </td>
        <td class="input">
            <div>
                <form action="<?php echo url::site().'user/add_user' ?>" method="post" >
                    <table cellspacing="5">
                        <tr><td colspan="3" align="center">Tambah User</td></tr>
                        <tr>
                            <td>Username</td><td style="width:5px">:</td><td align="right"><input name="username" type="text" style="width: 205px"/></td>
                        </tr>
                        <tr>
                            <td>Password</td><td style="width:5px">:</td><td align="right"><input name="password" type="password" style="width: 205px"/></td>
                        </tr>
                        <tr>
                            <td>Peran</td><td style="width:5px">:</td>
                            <td align="left">
                                <select name="ID_role">
                                    <?php foreach($roles->get_all_role() as $role) :?>
										<option value="<?php echo $role->ID_role ?>"><?php echo $role->nama?></option>                                 
									<?php endforeach ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2"></td><td align="right"><input type="submit" value="Submit" /></td>
                        </tr>
                    </table>
                </form>
            </div>
            <div style="margin: 0px auto">
                <form action="<?php echo url::site().'user' ?>" method="post" >
                    <table cellspacing="5">
                        <tr><td colspan="3" align="center">Edit User Password</td></tr>
                        <tr>
                            <td>Username</td><td style="width:5px">:</td>
                            <td align="left">
                                <select name="item">
                                    <!-- Dummy: harusnya make php foreach -->
                                    <option value="admin">Admin</option>
                                    <option value="owner">Owner</option>
                                    <option value="manajer_keuangan">Manajer Keuangan</option>
                                    <option value="manajer_humas">Manajer Pemasaran</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>Password Lama</td><td style="width:5px">:</td><td align="right"><input name="oldpass" type="password"/></td>
                        </tr>
                        <tr>
                            <td>Password Baru</td><td style="width:5px">:</td><td align="right"><input name="newpass" type="password"/></td>
                        </tr>
                        <tr>
                            <td colspan="2"></td><td align="right"><input type="submit" value="Submit" /></td>
                        </tr>
                    </table>
                </form>
            </div>
        </td>
    </tr>
</table>